<template>
  <div>
    <el-container>
      <el-header>
        <div class="logo">UIM-admin</div>
        <div>
          <el-menu
            :default-active="activeIndex"
            class="el-menu-demo"
            mode="horizontal"
            @select="handleSelect"
            background-color="pink"
            
          >
            <el-menu-item index="1">商品</el-menu-item>
            <el-menu-item index="2">订单</el-menu-item>
            <el-menu-item index="3">处理</el-menu-item>
            <el-menu-item index="4">设置</el-menu-item>
            <el-submenu index="2">
              <template slot="title">我的工作台</template>
              <el-menu-item index="2-1">修改</el-menu-item>
              <el-menu-item index="2-2">退出</el-menu-item>
            </el-submenu>

            <el-menu-item index="4"></el-menu-item>
          </el-menu>
        </div>
      </el-header>
      <el-container>
        <el-aside width="200px" id="aside">
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
          >
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>商品管理</span>
              </template>

              <el-submenu index="1-4">
                <template slot="title">选项4</template>
                <el-menu-item index="1-4-1">选项1</el-menu-item>
              </el-submenu>
            </el-submenu>
            <el-menu-item index="2">
              <i class="el-icon-menu"></i>
              <span slot="title">商品管理</span>
            </el-menu-item>

            <el-menu-item index="4">
              <i class="el-icon-setting"></i>
              <span slot="title">设置</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>Main</el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {};
  },
  mounted() {
    this.setMenuH();
  },
  methods: {
    setMenuH() {
      //   计算浏览器的可视高度
      let html = document.documentElement || document.body;
      let wh = html.clientHeight;
      // aside的高度
      aside.style.height = wh - 60 + "px";
    }
  },
  computed: {},
  watch: {}
};
</script>

<style lang="scss" scoped>
.el-header {
  display: flex;
  justify-content: space-between;
  line-height: 60px;
  font-weight: bold;
  background: pink;
}
</style>